import json
from config.logger import log


#初始化字典
data = {"track_data":[{"data":{}}]}
flag = 0
user_input = None
log.warning("回车确认输入，输入#后退出并保存")
key_cache = []
while True:
    if flag == 0:
        log.info("请输入埋点标题类型\n")
        user_input = input(  )
        key = user_input
        data["track_data"][0][key] = -1
        log.info("请输入埋点标题内容\n")
        user_input = input(  )
        data["track_data"][0][key] = user_input
        flag = 1
        log.debug(data)
    else:
        user_input = input("请输入埋点内容")
        key_cache.append(user_input)
        data["track_data"][0]["data"][user_input] = -1
        log.debug(data)


    if user_input == "#":
        break






    log.info(data)





